package com.leen.common.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(
        description = "接收分页参数类"
)
public class PageDTO {
    @ApiModelProperty(
            value = "当前第几页，默认为1",
            example = "1"
    )
    private Integer pageNumber;
    @ApiModelProperty(
            value = "每页显示几笔，默认为5",
            example = "5"
    )
    private Integer pageSize;

    public PageDTO() {
    }

    public Integer getPageNumber() {
        return this.pageNumber == null ? 1 : this.pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Integer getPageSize() {
        return this.pageSize == null ? 5 : this.pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return "PageDTO{pageNumber=" + this.pageNumber + ", pageSize=" + this.pageSize + '}';
    }
}
